//
//  XOClubImageViewController.m
//  didigo
//
//  Created by JS_Coder on 2019/3/1.
//  Copyright © 2019 lifayu. All rights reserved.
//

#import "XOClubImageViewController.h"

@interface XOClubImageViewController ()
StrongProperty UIScrollView * scrollView;
StrongProperty UIImageView * imageVIew;
@end


@implementation XOClubImageViewController

- (UIScrollView *)scrollView {
    if (_scrollView != nil) {
        return _scrollView;
    }
    _scrollView = [[UIScrollView alloc]initWithFrame:self.view.bounds];
    [_scrollView setZoomScale:2.0];
    [_scrollView setMinimumZoomScale:0.5];
    [_scrollView setBounces:YES];
    [_scrollView setScrollEnabled:YES];
    _scrollView.backgroundColor = UIColor.blackColor;
    return _scrollView;
}

-(UIImageView *)imageVIew {
    if (_imageVIew != nil) {
        return _imageVIew;
    }

    _imageVIew = [[UIImageView alloc]init];
    return _imageVIew;
}

- (void)setImage:(UIImage *)image {
    _image = image;
    self.imageVIew.image = self.image;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view addSubview: self.scrollView];
    [_scrollView addSubview: self.imageVIew];
    self.imageVIew.contentMode = UIViewContentModeScaleAspectFill;
    self.scrollView.contentSize = CGSizeMake(self.view.bounds.size.width + 10, self.view.size.height + 10);
    [self configNavigationLeftItemWithImage:[UIImage imageNamed:@"back_icon"]];
}

@end
